/*
	swap
*/
#include <stdio.h>
#include <stdlib.h>
int swap2(int** x,int** y){
		int* tmp = *x;
		*x = *y;
		*y = tmp;
	}
void swap(int* x,int* y){
		int temp = *x;
		*x = *y;
		*y = temp;
	}
int main (){
	int a = 10;
	int b = 4;
	//在子函数中改变当前变量，需要传递该变量的地址
	swap(&a,&b);
	printf("a = %d,b = %d \n",a,b);
	int *p = &a;
	int *q = &b;
	//在该函数中使得p指向b;是q指向a
	//在子函数中改变当前变量，需要传递该变量的地址
	swap2(&p,&q);
	printf("*p = %d *q = %d \n",*p,*q);
	return 0;
	//*取值 &取址
	}
